﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace FoodManager
{
    public partial class frMain : Form
    {
        private Dictionary<string, Form> childform = new Dictionary<string, Form>();
        public frMain()
        {
            InitializeComponent();
        }

        private void mnQuanLySanPham_Click(object sender, EventArgs e)
        {

            frNhapSanPham f = new frNhapSanPham();
            f.MdiParent = this;
            f.Show();
        }

        private void nhapdonhangPToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form1 f = new Form1();
            f.MdiParent = this;
            f.Show();
        }

        private void mnquanlykhachhang_Click(object sender, EventArgs e)
        {
            frQuanLyKhachHang f = new frQuanLyKhachHang();
            f.MdiParent = this;
            f.Show();
        }

        private void frMain_Load(object sender, EventArgs e)
        {
            this.menuStrip1.Visible = false;
            if (!Program.CurrentUser.IsLogin)
            {
                Login f = new Login();
                f.MdiParent = this;
                f.LoginEvent += f_Login;
                f.Show();
            }
        }

        void f_Login(object sender, EventArgs e)
        {
            if(Program.CurrentUser.IsLogin)
                this.menuStrip1.Visible = true;
        }

        private void mnBaoCaoSoChe_Click(object sender, EventArgs e)
        {
            frBaoCaoSoChe f = new frBaoCaoSoChe();
            f.MdiParent = this;
            f.Show();
        }

        private void mnBaoCaoDatHang_Click(object sender, EventArgs e)
        {
            frBaoCaoDatHang f = new frBaoCaoDatHang();
            f.MdiParent = this;
            f.Show();
        }

        private void mnBaoCaoDoanhThu_Click(object sender, EventArgs e)
        {
            frBaoCaoDoanhThu f = new frBaoCaoDoanhThu();
            f.MdiParent = this;
            f.Show();
        }

        private void mnBaoCaoCongNo_Click(object sender, EventArgs e)
        {
            frBaoCaoCongNo f = new frBaoCaoCongNo();
            f.MdiParent = this;
            f.Show();
        }

    }
}
